package com.lyf.design.summary.rpc;

import java.util.List;

/**
 * @AUTHOR LYF
 * @DATE 2022/6/6
 * @VERSION 1.0
 * @DESC
 */
public class ServerNode implements Runnable{
    public enum STATE{
        LEADER,FOLLOWER
    }

    private String name;
    private String voteFor;
    private Integer vote;
    private Long timeout=5000L;// 5s
    private Long startTime;//计时

    @Override
    public void run() {
          // 定时器
        // 当 curTime - startTime <=timeout 时 则等待接受心跳，未有接受到LEADER的心跳则--

        // 1.进行注册--
        boolean rs = ServerRegisterCentor.register(this);

        if(rs){



        }else{
            System.out.println("注册失败...");
        }
    }


}
